Convert SQL queries to python

welcome to shbcf.ru